let url = 'voice(//127.0.0.1:5500/prototype.html)'

let file = 'file[akjdfkasjklgjsajgfjsagjslakfaasdfsafsfsa]'

let emoji = 'sajdas[10][21]sakjfsa[1231]slakfl'

let reg = /^(voice\()(.+)(\)$)/g;
let reg1 = /^(file\[)(.+)(\]$)/g;
let regEmoji = /(\[[0-9]+\])/g;

// let result = emoji.replace(regEmoji , function(item){
//     let reg = /\[([0-9]+)\]/g;
//     item.match(reg)
//     return `<img src='sdfsfsfas${RegExp.$1}' >`
// })

let regContent = /\((.+?)\)/g;
let content = '[小红](56461)邀请[10](sadhfahga) [21](ashdfas) [1231](sdaf)加入了群聊'
let result = content.replace(regContent , function(item){
 
   return ''
})
let regContent1 = /\[(.+?)\]/g;
result = result.replace(regContent1 , function(item){
    item.match(regContent1)
    return RegExp.$1
 })
console.log(result)

